package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;

/**
 * 回帖实体类
 */
public class ReplyBean {
    private int id;
    /** 回帖标题 */
    private String title;
    /** 回帖内容 */
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime date = LocalDateTime.now();
    /** 频道对象 */
    private PostBean postBean;
    /** 用户对象 */
    private String user;

    public ReplyBean() {
    }

    public ReplyBean(String title, String content, int postId, String user, LocalDateTime date) {
        this.title = title;
        this.content = content;
        this.date = date;
        this.postBean = new PostBean();
        postBean.setId(postId);
        this.user = user;
    }

    public ReplyBean(int id, String title, String content, LocalDateTime date, int postId, String user) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.date = date;
        this.postBean = new PostBean();
        postBean.setId(postId);
        this.user = user;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getDate() {
        return date;
    }

    public void setDate(LocalDateTime date) {
        this.date = date;
    }

    public PostBean getPostBean() {
        return postBean;
    }

    public void setPostBean(PostBean postBean) {
        this.postBean = postBean;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "ReplyBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", date=" + date +
                ", postBean=" + postBean +
                ", user=" + user +
                "}\n";
    }

}
